class Person {
    constructor(name) {
      this.name = name;
    }
  
    sayHello() {
     return `Hello, my name is ${this.name}.`
    }
  }
  

class Student extends Person {
    constructor(name, grade) {
      super(name);
      this.grade = grade;
    }

    selfIntroduction() {
      return this.sayHello() + `I am in grade ${this.grade}.`
    }
    
}
const student = new Student('张三', 10);
console.log(student.selfIntroduction());


class Foo {
  constructor(...args) {
    this.args = args;
  }
  * [Symbol.iterator]() {
    for (let arg of this.args) {
      yield arg;
    }
  }
}

for (let x of new Foo('hello', 'world')) {
  console.log(x);
}
